#include <iostream>
#include <string>
#include <map>
#include <set>
#include <vector>
using namespace std;
const vector<int> encode_string(string& s)
{
    map<char,int> m;
    vector<int> encode_vector;
    for(int i=0;i<s.length();i++)
    {
        if(~m.count(s[i]))
            m.insert({s[i],i});
        else
            continue;
    }
    for(auto i:s)
        encode_vector.push_back(m[i]);
    return encode_vector;


}
void show(vector<int>& a)
{
    for(auto i:a)
        cout<<i<<" ";
    cout<<"\n";
}
int main() {
//    string source = "ababcb";
    string source = "aaaaaaaaaaaa";
    string target = "xyx";
    vector<int> m = encode_string(target);
    vector<int> sub;
    int count = 0;
    for(int i=0;i<source.length()-target.length()+1;i++)
    {
        string substr = source.substr(i,target.length());
        sub = encode_string(substr);
        if(sub == m)
            count++;
    }
    cout<<count<<"\n";
    return 0;
}